<?php
class bookController extends CController {
	public function actionIndex() {
		$book = new Guestbook ( );
		$rows = $book->with("Line")->findAll ( array (
			
			"select" => "type_id,state,message,level,uid", 
			//"condition" => "", 
			"group" => "state", 
			"order" => "gid desc", 
			"limit" => 1 
		) );
		$i = 0;
		foreach ( $rows as $v ) {
			$book_rows [$i] ["type_id"] = $v->type_id;
			$book_rows [$i] ["lname"] = $v->Line->lname;
			$book_rows [$i] ["state"] = $v->state;
			$book_rows [$i] ["message"] = $v->message;
			$book_rows [$i] ["level"] = $v->level;
			$book_rows [$i] ["uid"] = $v->uid;
			$i ++;
		}
		$line = new Line ( );
		$line_rows = $line->findByPk ( '13' );
	}
}
?>